package com.shuyuwl.core.enums;

/**
 * 字典类型枚举
 *
 * @author liaokx
 * @date 2019/10/31 16:24
 */
public enum DictTypeEnum {


    VALUE((byte)1, "字符值"),
    KEY_VALUE((byte)2, "键值对"),
    ENUM_VALUE((byte)3, "枚举类");

    private Byte code;

    private String message;

    DictTypeEnum(Byte code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * 找出value
     * @param status
     * @return
     */
    public static  DictTypeEnum findOne(Byte status){
        for (DictTypeEnum value : DictTypeEnum.values()) {
            if(value.getCode().equals(status)){
                return value;
            }
        }
        return null;
    }

     void setCode(Byte code) {
        this.code = code;
    }

    public Byte getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

     void setMessage(String message) {
        this.message = message;
    }

}
